'use client';

import { useId, useState } from 'react';
import { Link } from 'waku/router/client';

export const Counter = () => {
  const [count, setCount] = useState(0);
  const id = useId();
  return (
    <div style={{ border: '3px blue dashed', margin: '1em', padding: '1em' }}>
      <p>Count: {count}</p>
      <button id={id} onClick={() => setCount((c) => c + 1)}>
        Increment
      </button>
      <h3>This is a client component.</h3>
      <Link to="/">Go to Home</Link>
    </div>
  );
};
